from gaesessions import SessionMiddleware

# suggestion: generate your own random key using os.urandom(64)
# WARNING: Make sure you run os.urandom(64) OFFLINE and copy/paste the output to
# this file. If you use os.urandom() to *dynamically* generate your key at
# runtime then any existing sessions will become junk every time you start,
# deploy, or update your app!
import os
COOKIE_KEY = "p&\x19``Aw'\x19NL\xbcxo\xbc\xb0\xb9r\xba\xfd\xcf\xe6z\x84\xdf\xe6\x81\xc6p\xf6\xea~\x8c\xb5\xe0`  \xc3\x95}\x1a\xc6\x0f\x9f\xc2O\xe5\xda\xab\xf9\xe7g\xbf\xb4\xa6p\xf5\x0cW\xab(9\x8b\xae"

def webapp_add_wsgi_middleware(app):
  from google.appengine.ext.appstats import recording
  app = SessionMiddleware(app, cookie_key=COOKIE_KEY)
  return app